]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
bluetooth: Update bluetooth submenu title
authorMariana Picolo <marianapicolo@hotmail.com>
Sat, 28 Mar 2020 18:56:20 +0000 (15:56 -0300)
committerMariana Pícolo <marianapicolo@hotmail.com>
Thu, 2 Apr 2020 00:15:37 +0000 (00:15 +0000)
- "Bluetooth" to "on/off" labels
  to match with other menus

- Display single connected device name
  to show more relevant information

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2340

js/ui/status/bluetooth.js

index 8ba98ab4913c2b475b0c493ecf89c615998f8356..ab167be02891052022fc58b23f4a4cfc91061502 100644 (file)
@@ -90,6 +90,8 @@ class Indicator extends PanelMenu.SystemIndicator {
             deviceInfos.push({
                 connected: this._model.get_value(iter,
                     GnomeBluetooth.Column.CONNECTED),
+                name: this._model.get_value(iter,
+                    GnomeBluetooth.Column.ALIAS),
             });
 
             ret = this._model.iter_next(iter);
@@ -122,14 +124,16 @@ class Indicator extends PanelMenu.SystemIndicator {
         else
             this._item.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
 
-        if (nConnectedDevices > 0)
+        if (nConnectedDevices > 1)
             /* Translators: this is the number of connected bluetooth devices */
-            this._item.label.text = ngettext("%d Connected", "%d Connected", nConnectedDevices).format(nConnectedDevices);
+            this._item.label.text = ngettext('%d Connected", "%d Connected', nConnectedDevices).format(nConnectedDevices);
+        else if (nConnectedDevices === 1)
+            this._item.label.text = connectedDevices[0].name;
         else if (adapter === null)
-            this._item.label.text = _("Off");
+            this._item.label.text = _('Bluetooth Off');
         else
-            this._item.label.text = _("On");
+            this._item.label.text = _('Bluetooth On');
 
-        this._toggleItem.label.text = this._proxy.BluetoothAirplaneMode ? _("Turn On") : _("Turn Off");
+        this._toggleItem.label.text = this._proxy.BluetoothAirplaneMode ? _('Turn On') : _('Turn Off');
     }
 });